package cn.com.ulez.databasedemo;

import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.util.Log;

import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    private DBManager dbManager;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        PhotoUpImageItem photoUpImageItem=new PhotoUpImageItem(451,"/storage/emulated/0/Yado/camerajap/Lepton_160x120.jpg","北京海淀区...",45.23,2.12);
        dbManager = new DBManager(this);
        List list=new ArrayList<PhotoUpImageItem>();
        list.add(photoUpImageItem);
        dbManager.add(list);
//        dbManager.clearData();
       ArrayList<PhotoUpImageItem> imageItems= dbManager.searchDataByPath("/storage/emulated/0/Yado/camerajap/Lepton_160x120.jpg");
        for (PhotoUpImageItem item:imageItems){
            Log.e("LCy", "id="+item.getImageId()+",地名为=="+item.getAddress()+item.getImagePath()+"最高温="+item.getMaxTemp()+"最低温="+item.getMinTemp());
        }
    }
}
